import java.util.Arrays;

public class Testdemo {
    public static double avg(int[] a){
        int ret=0;
        double sum;
        for (int x:a) {
            ret+=x;
        }
        sum=ret/a.length;
        return sum;
    }

    public static int sum(int[] a){
        int sum=0;
        for (int x:a) {
            sum+=x;
        }
        return sum;
    }

    public static int[] transform(int[] a){
        for (int i = 0; i < a.length; i++) {
            a[i]*=2;
        }
        return a;
    }

    public static void printArray(int[] a){
//        for (int x: a) {
//            System.out.println(a[x]);
//        }
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }

    public static int[] create(int[] a){
        int[] a1=new int[101];
        for (int i = 0; i <= 100; i++) {
           a1[i]=i;
        }
        return a1;
    }
    public static String toString(int[] arr) {
        String ret = "\"";
        ret += "[";
        for (int i = 0; i < arr.length; i++) {
            if (i < arr.length - 1) {
                ret += arr[i] + ",";
            } else if (i == arr.length - 1) {
                ret += arr[i] + "]";
            }
        }
        ret += "\"";
        return ret;
    }
    public static void main(String[] args) {
        int[] arr = {1, 2, 3};
        String s = toString(arr);
        System.out.println(s);
    }

    public static void main4(String[] args) {
        int[] a= {1,2,3,4,5,6,7};
        int[] copy = new int[a.length];
        System.arraycopy(a,0,copy,0,a.length);
        System.out.println(Arrays.toString(copy));
    }
    public static void main2(String[] args) {
        int[] a={};
        System.out.println(Arrays.toString(create(a)));
    }
    public static void main1(String[] args) {
        int[] array= {1,2,3,4,5};
        //System.out.println(avg(array));
        //System.out.println(sum(array));
        //System.out.println(Arrays.toString(transform(array)));
        printArray(array);
    }
}

